﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="LizzabethBrownRealEstate.Views.Admin.UserList" %>
<%@ Import Namespace="LizzabethBrownRealEstate.Controllers" %>
<%@ Import Namespace="LizzabethBrownRealEstate.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div class="contentDiv" style="margin-left:25%; margin-top:30px">
        <fieldset>
            <legend>Users</legend>
            <% LBRDataContext c = new LBRDataContext(); %>
            <table width="100%" style="border-collapse:collapse;">
            <% foreach (User u in c.Users)
               {
                   if (u.Deleted) continue;%>
               <tr style="cursor:pointer">
                    <td  onmouseover="javascript:this.style.backgroundColor='Silver';" onmouseout="javascript:this.style.backgroundColor='Transparent'"><%= u.First + " " + u.Last %></td>
                    <td><a href='<%= Url.Action("EditUser", new { Controller = "Admin", userId = u.UserId.ToString() })%>' class="linktableButton">Edit</a></td>
                    <td><a onclick="javascript:return confirm('Delete this user?')" href='<%= Url.Action("DeleteUser", new { Controller = "Admin", Id = u.UserId.ToString() })%>' class="linktableButton">Delete</a></td>
               </tr>
            <%} %>
            </table>
        </fieldset>
    </div>
</asp:Content>
